package com.PAT.practice02;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/02/18/13:30
 * @Description:
 * @Target:
 */
public class A除以B {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
//        Scanner in = new Scanner(System.in);
//        String ss1 = in.nextLine();
        String ss1 = bufferedReader.readLine();
        String[] s = ss1.split(" ");
     /*   if ("0".equals(s[0])){
            System.out.println(0+" "+0);
        }*/
        String[] strings = dealWith(s[0], Integer.valueOf(s[1]));
        System.out.println(strings[0]+" "+strings[1]);
    }


     // 152/2

    static String[] dealWith(String ss,int k){
        String[] strings = new String[2];
        int lastInt = 0;  // 记录上一个数，余数
        strings[0] = "";
        int m = 0;
        for (int i = 0; i < ss.length(); i++) {
            Integer integer = lastInt*10+Integer.valueOf((ss.charAt(i)-'0'));
            m = (int)(integer/k);
            lastInt = integer % k;

            if ("0".equals(strings[0])) {
                strings[0] = "";
            }
            strings[0]+=m;
        }
        strings[1] = lastInt+"";
        return strings;
    }
}
